<?php
declare (strict_types = 1);

namespace app\api\model;

use think\Model;

/**
 * @mixin \think\Model
 */
class Config extends Model
{
     protected $json=['option_value'];


      /**
     * 本地上传配置信息
     * @return array
     */
    public static function upload()
    {
        $uploadcfg = config('upload');

        $uploadurl  = '/ajax/upload' ;      

        if (!preg_match("/^((?:[a-z]+:)?\/\/)(.*)/i", $uploadurl) && substr($uploadurl, 0, 1) !== '/') {
            $uploadurl = url($uploadurl, '', false);
        }

        $upload = [
            'cdnurl'    => $uploadcfg['cdnurl'],
            'uploadurl' => $uploadurl,
            'bucket'    => 'local',
            'maxsize'   => $uploadcfg['maxsize'],
            'mimetype'  => $uploadcfg['mimetype'],
            'chunking'  => $uploadcfg['chunking'],
            'chunksize' => $uploadcfg['chunksize'],
            'savekey'   => $uploadcfg['savekey'],
            'multipart' => [],
            'multiple'  => $uploadcfg['multiple'],
            'storage'   => 'local'
        ];
        return $upload;
    }

    /**
     *
     *
     * 
     */
}
